﻿(function () {
    $("#colseHeadPhoto").live("click",function () {
        $("#altContent").hide();
        $(".ui-mask").hide();
    });
    $(".uploadbox").click(function () {
        var dataCount = $(this).attr("data-count");
        if (dataCount == 1) {
            return;
        }
        var dataValue = $(this).attr("data-value");
        if (dataValue==undefined||dataValue==null||dataValue=="") {
            dataValue = "djack";
        }
        $("#altContent").show();
        $(".ui-mask").show();
        var imgWidth = 162;
        var imgHeight = 162;
        switch (dataValue) {
            case "food":
                imgWidth = 240;
                imgHeight = 198;
                break;
            case "scenic":
                imgWidth = 240;
                imgHeight = 198;
                break;
            case "specialty":
                imgWidth = 240;
                imgHeight = 198;
                break;
            default:
                dataValue = "djack";
                imgWidth = 162;
                imgHeight = 162;
                break;
        }
        var flashHtml = "<object width='650' height='450' id='myMovieName'><param name='movie' value='/jqPlugin/hdfu/avatar.swf'><param name='quality' value='high'><param name='bgcolor' value='#FFFFFF'><param name='flashvars' value='imgUrl=/jqPlugin/hdfu/default.jpg&uploadUrl=/jqPlugin/hdfu/upfile.aspx?type=" + dataValue + "&uploadSrc=false&pCut=" + imgWidth + "|" + imgHeight + "&pSize=" + imgWidth + "|" + imgHeight + "&pData=" + imgWidth + "|" + imgHeight + "' /><embed src='/jqPlugin/hdfu/avatar.swf' quality='high' bgcolor='#FFFFFF' width='650' height='450' wmode='transparent' flashvars='imgUrl=/jqPlugin/hdfu/default.jpg&uploadUrl=/jqPlugin/hdfu/upfile.aspx?type=" + dataValue + "&uploadSrc=false&pCut=" + imgWidth + "|" + imgHeight + "&pSize=" + imgWidth + "|" + imgHeight + "&pData=" + imgWidth + "|" + imgHeight + "' name='myMovieName' align='' type='application/x-shockwave-flash' allowscriptaccess='always'></embed></object><span class='close' id='colseHeadPhoto'>&times;</span>";
        $("#altContent").html(flashHtml);
    });
})();
function uploadevent(status, picUrl, callbackdata) {
    status += '';
    switch (status) {
        case '1':
            var time = new Date().getTime();
            var filename162 = picUrl + '_162.jpg';
            $("#altContent").hide();
            $(".ui-mask").hide();
            document.getElementById('imgHead').innerHTML = "<img src='" + filename162 + "?" + time + "'/>";

            break;
        case '-1':
            $("#altContent").hide();
            $(".ui-mask").hide();
            break;
        default:
            window.location.reload();
    }
}